package {
	import flash.geom.*;
	import flash.display.*;
	import flash.display.Bitmap;
	import flash.display.Loader;
	import flash.events.*;
	import flash.events.Event;
	import flash.events.IOErrorEvent;
	import flash.events.SecurityErrorEvent;
	import flash.net.*;
	import flash.net.URLLoader;
	import flash.net.URLLoaderDataFormat;
	import flash.net.URLRequest;
	import flash.net.URLVariables;
	import flash.system.ApplicationDomain;
	import flash.system.LoaderContext;
	import flash.system.SecurityDomain;
	import flash.text.TextField;
	import flash.text.TextFormat;
	import flash.utils.ByteArray;

	import cmodule.ccal.CLibInit;

	public class Test extends Sprite
	{
		private var text:TextField = new TextField();
		public function Test()
		{
			addChild(text);
			text.width = 400;
			text.height = 300;
			text.border = true;
			//text.wordWrap = true;
			//text.defaultTextFormat = new TextFormat(null,12,0x3399ee);
			text.text = bmpd2bytes(null);;
		}

		private static var lib:Object = null;
		public static function bmpd2bytes(bmpd:BitmapData):String
		{
			if(lib==null){
				lib = new cmodule.ccal.CLibInit().init();
			}
			return lib.encode();
		}

	}
}
